/******************************************************************************
* File description: SettingModelConfigHunHeUI.cpp
* Function: 模型配置：混合判定
* Current Version: 1.0.0
* Author: 张宇轩
* Date: 2024-08-19
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
#include "settingmodelconfighunheui.h"

/**
 * @brief 构造函数
 */
SettingModelConfigHunHeUI::SettingModelConfigHunHeUI()
{
    // 初始化
    this->setResizeMode(QQuickWidget::SizeRootObjectToView);
    this->setFixedSize(440, 358);
    this->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint);
    this->setWindowTitle("混合判定");

    this->_rootContext = this->getContext();
    // 传入ModelConfigNewUI类
    this->rootContext()->setContextProperty("modelConfHunhe", this);
    // 资源加载
    this->setSource(QUrl("qrc:/SettingModelConfigHunHe.qml"));
    this->_rootObj = this->getRootObject();
    if(_rootObj)
    {
        // 取消
        connect(_rootObj, SIGNAL(cancel()), this, SLOT(onCancel()));
    }
}

/**
 * @brief 析构函数
 */
SettingModelConfigHunHeUI::~SettingModelConfigHunHeUI() {}

/**
 * @brief getContext 获取qmlcontext
 * @return qmlContext
 */
QQmlContext* SettingModelConfigHunHeUI::getContext() const
{
    return this->rootContext();
}

/**
 * @brief getRootObject 获取rootObject
 * @return rootObject
 */
QObject* SettingModelConfigHunHeUI::getRootObject() const
{
    return (QObject*)this->rootObject();
}

/**
 * @brief 取消
 */
void SettingModelConfigHunHeUI::onCancel()
{
    this->close();
}

/**
 * @brief 页面显示
 */
void SettingModelConfigHunHeUI::hunheShow()
{
    this->show();
}
